import request from '@/utils/request.js'

export const httpAppCategories = () => {
  return request({
    url: '/classification/show',
    method: 'get'
  })
}

export const httpAppList = (params) => {
  return request({
    url: '/application/show',
    method: 'get',
    params
  })
}

export const httpCreateApp = (data) => {
  return request({
    url: '/application/' + (data.application_id ? 'update' : 'add'),
    method: 'post',
    data
  })
}

export const httpDeleteApp = (application_id) => {
  const data = {application_id}
  return request({
    url: '/application/del',
    method: 'post',
    data
  })
}

export const httpSelectApp = (application_id) => {
  const params = {application_id}
  return request({
    url: '/application/select',
    method: 'get',
    params
  })
}

export const httpCollectApp = (application_id) => {
  const params = {application_id}
  return request({
    url: '/application/collection',
    method: 'get',
    params
  })
}

export const httpApply = (data) => {
  return request({
    url: '/application/apply',
    method: 'post',
    data
  })
}